/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package domain;

import domain.exceptions.*;
import java.util.Iterator;
import java.util.Scanner;
import presentation.Client;

/**
 *
 * @author shaigi
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws CannotPlaceAgentHereException {
        /**
         * Initlization
         */
    	//Scanner reader=new Scanner(System.in);
    	//int numberOfAgents;
        
        
        
    	// initialize game (but without agents yet):
        Board board = new Board("board.txt");
        //Game.board = new Board("board.txt");
        Game game = new Game(board);
        
        // initialize gui:
        Client c = new Client(game);
        
        game.initialize();
        
        // subscribe client for all agents:
        for (Iterator<Agent> it = game.getAgents().iterator(); it.hasNext();) {
            Agent agent = it.next();
            agent.subscribe(c);
        }
        game.placeAgents();
        game.start();
        //System.out.println("Please enter the amount of agents you want");
        //numberOfAgents = reader.nextInt();
        
        
        
        /**
        
        /*
        System.out.println("is wall? " + Game.board.getSquare(0, 2));
        System.out.println("is flag? " + Game.board.getSquare(1, 4));
        System.out.println("is ice?  " + Game.board.getSquare(3, 10));
        
        Agent a = new AgentHuman();
        Game.board.placeAgent(a, 2, 3);
        try {
            a.move(domain.Game.direction.UP);
            a.move(domain.Game.direction.UP);
            //a.move(domain.Game.direction.UP);
        } catch (CannotMoveThereException ex) {
            System.out.println("Exception caught: " + ex.getMessage());
        }
         */
    }

}
